home *** CD-ROM | disk | FTP | other *** search
/ Apple WWDC 1996 / WWDC96_1996 (CD).toast / Technology Materials / MacOS 8 Resources / Developer Tools / Mac OS 8 Interfaces & Libraries / Interfaces / PInterfaces / SystemNotification.p < prev    next >
Text File  |  1996-05-01  |  4KB  |  152 lines

  1. {
  2.      File:        SystemNotification.p
  3.  
  4.      Contains:    System Notification Service Interfaces.
  5.  
  6.      Version:    Technology:    System 8
  7.                  Release:    Universal Interfaces 3.0d3 on Copland DR1
  8.  
  9.      Copyright:    © 1984-1996 by Apple Computer, Inc.  All rights reserved.
  10.  
  11.      Bugs?:        If you find a problem with this file, send the file and version
  12.                  information (from above) and the problem description to:
  13.  
  14.                      Internet:    apple.bugs@applelink.apple.com
  15.                      AppleLink:    APPLE.BUGS
  16.  
  17. }
  18. {$IFC UNDEFINED UsingIncludes}
  19. {$SETC UsingIncludes := 0}
  20. {$ENDC}
  21.  
  22. {$IFC NOT UsingIncludes}
  23.  UNIT SystemNotification;
  24.  INTERFACE
  25. {$ENDC}
  26.  
  27. {$IFC UNDEFINED __SYSTEMNOTIFICATION__}
  28. {$SETC __SYSTEMNOTIFICATION__ := 1}
  29.  
  30. {$I+}
  31. {$SETC SystemNotificationIncludes := UsingIncludes}
  32. {$SETC UsingIncludes := 1}
  33.  
  34. {$IFC UNDEFINED __KERNEL__}
  35. {$I Kernel.p}
  36. {$ENDC}
  37. {$IFC UNDEFINED __FILEMANAGERTYPES__}
  38. {$I FileManagerTypes.p}
  39. {$ENDC}
  40. {$IFC UNDEFINED __NAMEREGISTRY__}
  41. {$I NameRegistry.p}
  42. {$ENDC}
  43.  
  44. {$PUSH}
  45. {$ALIGN POWER}
  46. {$LibExport+}
  47.  
  48. {$IFC FOR_SYSTEM8_PREEMPTIVE }
  49. {
  50.  * basic notification data structures and constants
  51. }
  52.  
  53. CONST
  54.     kSNSMatchAnyService            = '****';
  55.     kSNSMatchAnyKind            = '****';
  56.  
  57.  
  58. TYPE
  59.     SNSService                            = OSType;
  60.     SNSKind                                = OSType;
  61.     SNSSubjectVariantPtr = ^SNSSubjectVariant;
  62.     SNSSubjectVariant = RECORD
  63.         CASE INTEGER OF
  64.         0: (
  65.             genericSubject:        PACKED ARRAY [0..255] OF CHAR;
  66.             );
  67.         1: (
  68.             nsObject:            ObjectID;
  69.             );
  70.         2: (
  71.             fsPersistence:        FSObjectPersistentReference;
  72.             );
  73.         3: (
  74.             fsObject:            FSEventObjectSubject;
  75.             );
  76.         4: (
  77.             fsObjectProperty:    FSEventObjectPropertySubject;
  78.             );
  79.         5: (
  80.             nameRegistryEntry:    RegEntryRef;
  81.             );
  82.     END;
  83.  
  84.     SNSSubjectPtr = ^SNSSubject;
  85.     SNSSubject = RECORD
  86.         subjectLength:            ByteCount;
  87.         subject:                SNSSubjectVariant;
  88.     END;
  89.  
  90.     SNSNotificationHeaderPtr = ^SNSNotificationHeader;
  91.     SNSNotificationHeader = RECORD
  92.         service:                SNSService;
  93.         kind:                    SNSKind;
  94.         subject:                SNSSubject;
  95.         subscriberRefCon:        Ptr;
  96.         infoLength:                ByteCount;
  97.     END;
  98.  
  99.     SNSNotificationPtr = ^SNSNotification;
  100.     SNSNotification = RECORD
  101.         header:                    SNSNotificationHeader;
  102.         info:                    SInt8;
  103.     END;
  104.  
  105. {
  106.  * producer data structures and constants
  107. }
  108.  
  109. CONST
  110.     kSNSFireAndForgetNotification = 0;
  111.     kSNSRequireAllConsumersSucceed = $00000001;
  112.     kSNSRequireOneConsumerSucceed = $00000002;
  113.  
  114.  
  115. TYPE
  116.     SNSProduceOptions                    = OptionBits;
  117.     SNSDistributorID                    = ObjectID;
  118. {
  119.  * consumer data structures and constants
  120. }
  121.     SNSConsumerID                        = ObjectID;
  122.     SNSConsumerName                        = OSType;
  123. {
  124.  * producer interface
  125. }
  126. FUNCTION SNSFindDistributor(service: SNSService; kind: SNSKind; createDistributor: BOOLEAN; VAR distributor: SNSDistributorID): OSStatus; C;
  127. FUNCTION SNSProduce(distributor: SNSDistributorID; notification: UNIV Ptr; notificationLength: ByteCount; subject: UNIV Ptr; subjectLength: ByteCount; options: SNSProduceOptions): OSStatus; C;
  128. FUNCTION SNSProduceAsync(distributor: SNSDistributorID; notification: UNIV Ptr; notificationLength: ByteCount; subject: UNIV Ptr; subjectLength: ByteCount; options: SNSProduceOptions; completion: KernelNotificationPtr): OSStatus; C;
  129. {
  130.  * consumer and subscription interface
  131. }
  132. FUNCTION SNSCreateConsumer(name: SNSConsumerName; maxPending: ItemCount; VAR consumer: SNSConsumerID): OSStatus; C;
  133. FUNCTION SNSDeleteConsumer(consumer: SNSConsumerID): OSStatus; C;
  134. FUNCTION SNSSubscribe(consumer: SNSConsumerID; service: SNSService; kind: SNSKind; subject: UNIV Ptr; subjectLength: ByteCount; refCon: UNIV Ptr): OSStatus; C;
  135. FUNCTION SNSUnsubscribe(consumer: SNSConsumerID; service: SNSService; kind: SNSKind; subject: UNIV Ptr; subjectLength: ByteCount): OSStatus; C;
  136. FUNCTION SNSHold(consumer: SNSConsumerID; service: SNSService; kind: SNSKind; subject: UNIV Ptr; subjectLength: ByteCount): OSStatus; C;
  137. FUNCTION SNSUnhold(consumer: SNSConsumerID; service: SNSService; kind: SNSKind; subject: UNIV Ptr; subjectLength: ByteCount): OSStatus; C;
  138. FUNCTION SNSFlush(consumer: SNSConsumerID; service: SNSService; kind: SNSKind; subject: UNIV Ptr; subjectLength: ByteCount): OSStatus; C;
  139. FUNCTION SNSConsume(consumer: SNSConsumerID; notification: SNSNotificationPtr; maxSize: ByteCount): OSStatus; C;
  140. FUNCTION SNSConsumeAsync(consumer: SNSConsumerID; notification: SNSNotificationPtr; maxSize: ByteCount; completion: KernelNotificationPtr): OSStatus; C;
  141. {$ENDC}
  142. {$ALIGN RESET}
  143. {$POP}
  144.  
  145. {$SETC UsingIncludes := SystemNotificationIncludes}
  146.  
  147. {$ENDC} {__SYSTEMNOTIFICATION__}
  148.  
  149. {$IFC NOT UsingIncludes}
  150.  END.
  151. {$ENDC}
  152.